home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / language / xscheme.arc / xscheme.ini < prev    next >
Text File  |  1989-02-02  |  915b  |  37 lines

  1. ; xscheme.ini - initialization code for XScheme version 0.16
  2.  
  3. (load "macros.s")
  4. (load "qquote.s")
  5.  
  6. ; this version of EVAL knows about the optional enviroment parameter
  7. (define (eval x #!optional env)
  8.   ((if (default-object? env)
  9.      (compile x)
  10.      (compile x env))))
  11.  
  12. (define (autoload-from-file file syms #!optional env)
  13.   (map (lambda (sym) (put sym '%autoload file)) syms)
  14.   '())
  15.   
  16. (define (*unbound-handler* sym cont)
  17.   (let ((file (get sym '%autoload)))
  18.     (if file (load file))
  19.     (if (not (bound? sym))
  20.       (error "unbound variable" sym))
  21.     (cont '())))
  22.  
  23. (define head car)
  24. (define (tail x) (force (cdr x)))
  25. (define empty-stream? null?)
  26. (define the-empty-stream '())
  27.  
  28. (macro cons-stream
  29.   (lambda (x)
  30.     (list 'cons (cadr x) (list 'delay (caddr x)))))
  31.  
  32. (macro make-environment
  33.   (lambda (x)
  34.     (append '(let ()) (cdr x) '((the-environment)))))
  35.  
  36. (define initial-user-environment (the-environment))
  37.